/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sv.com.intesal.compra.sql;

/**
 *
 * @author JM
 */
public class SQLDepartamento {

    //        public static final String INSERTAR="INSERT INTO categoria(nombre_cat) VALUES (?)";
//    public static final String MODIFICAR="UPDATE categoria SET nombre_cat=? WHERE id_cat=?";
//    public static final String ELIMINAR="DELETE FROM categoria WHERE id_cat=?";
//    public static final String ALL="SELECT id_cat, nombre_cat FROM categoria";
    public static final String INSERTAR = "INSERT INTO departamento(id_p, nombre_d) VALUES (?, ?)";
    public static final String MODIFICAR = "UPDATE departamento SET id_p=?, nombre_d=? WHERE id_d=?";
    public static final String ELIMINAR = "DELETE FROM departamento WHERE id_d=?";
    public static final String DEPARTAMENTO = "SELECT d.nombre_d, d.id_d, p.nombre_p,p.id_p FROM departamento As d, pais As p WHERE p.id_p = d.id_p order by p.nombre_p,d.nombre_d";
    public static final String ALLLista = "SELECT id_p, nombre_p FROM pais";
//    public static final String DepartamenoPorPais="SELECT d.nombre_d, d.id_d FROM pais As p, departamento AS d WHERE p.id_p = d.id_p AND p.id_p=?";

     public static final String getDepartamentos_x_Pais="SELECT d.id_d,p.id_p,p.nombre_p,d.nombre_d FROM PAIS as p,DEPARTAMENTO as d where p.id_p=d.id_p and p.id_p=? order by p.nombre_p,d.nombre_d";

}
